<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
			<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
		<title>全屏布局练习</title>
		<style>
			html,body{
				width: 100%;
				height: 100%;
				padding: 0;
				margin: 0;
				font-size: 20px;
				color: #fff;
			}
			div{
				box-sizing: border-box;
			}
			.contain{
				width: 100%;
				height: 100%;
			}
			.header{
				width: 100%;
				height: 50px;
				background: #E4B9C0;
				position: absolute;
				text-align: center;
				line-height: 50px;
			}
			.main{
				width: 100%;
				height: 100%;
				background: #B9DEF0;
				padding-top: 50px;
			}
			.main_l{
				float: left;
				width: 100px;
				height: 100%;
				background: #E74C3C;
				text-align: center;
			}
			.main_r{
		/*不设置宽度,利用margin:0 auto;的原理,让浏览器自动将-100之后剩余的宽度给main_r*/
				height: 100%;
				margin-left: 100px;
				border: 3px dashed #000;
				text-align: center;
			}
		</style>
	</head>
	<body>
		<div class="contain">
			<div class="header">顶部1</div>
			<div class="main">
				<div class="main_l">左侧2</div>
				<div class="main_r">右侧3</div>
			</div>
		</div>
	</body>
</html>
